home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / ACORNWEBSITE / ROMPATCH2-04 / TechNote < prev   
Text File  |  1997-10-22  |  2KB  |  60 lines

  1.  
  2. Technical note for RISC OS 3.70 and StrongARM, 24-Oct-96
  3. --------------------------------------------------------
  4.  
  5. You do not need to read this note in order to use the supplied patches;
  6. read the ReadMe file instead. This note is for those who develop code
  7. for RISC OS.
  8.  
  9. The SA110 (of revision less than 3, as specified in the ARM ID register)
  10. has a bug in the User Register Store Multiple instruction (STM^). This is
  11. the STM that is used to store user mode registers while in a privileged
  12. mode. If the STM^ is executed while a data cache fill is completing the
  13. store address for all but the first register may be wrong.
  14.  
  15. This should not affect any application or transient code (which will
  16. execute in user mode), nor typical module code, but may affect a few
  17. modules.
  18.  
  19. If you use STM^ in a module that is designed to work with StrongARM, we
  20. recommend the following workaround for the problem:
  21.  
  22.     Split the STM^ into a standard STM for the non banked registers
  23.     followed by an STM^ for the banked registers, adjusting the base
  24.     register afterwards as necessary.
  25.  
  26. A typical example follows:
  27.  
  28.     ;privileged mode  
  29.     STMIA r0,{r1-r14}^
  30.  
  31. becomes:
  32.  
  33.     ;privileged mode
  34.     STMIA r0!,{r1-r12}    ;store non-banked registers, writeback allowed
  35.     STMIA r0,{r13,r14}^   ;store banked registers
  36.     SUB   r0,r0,#12*4     ;adjust base register back
  37.  
  38. The banked registers are R13 and R14 (it is extremely unlikely that FIQ
  39. code would perform an STM^, since the extra banked registers are
  40. precisely to avoid this need). It may be possible to optimise the base
  41. register adjustment into the following code, depending on how the base
  42. register is used subsequently.
  43.  
  44. Note that this sequence is non-atomic and does manipulate the base
  45. register value. This is unlikely to be an issue, but the effect of an
  46. interrupt (if enabled) during this sequence may need to be borne in mind.
  47.  
  48. Similar workarounds apply to other cases. However, you should note the
  49. following standard ARM coding considerations:
  50.  
  51.   - The first (non-^) STM cannot use writeback if the base register is in
  52.     the store list; this is unlikely, because it is not particularly
  53.     useful to store the base of the stored block in the block.
  54.  
  55.   - The STM^ must not use writeback.
  56.  
  57.   - If the base register is one of the banked registers, then a NOP
  58.     should precede the SUB instruction (since the SUB then uses a banked
  59.     register).
  60.